home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / cenviw1.zip / BOOTED2.CMM < prev    next >
Text File  |  1993-07-12  |  1KB  |  29 lines

  1. /************************************************************
  2.  *** BootEd2 - Sample Cmm code to demonstrate uses of the ***
  3.  ***           spawn() function.                          ***
  4.  ************************************************************/
  5.  
  6. #include <WinExec.lib>
  7. #include <MsgBox.lib>
  8. #include <WinUtil.lib>
  9.  
  10. MessageBox("This example CEnvi program will start\n"
  11.            "NotePad to edit both C:\\Config.sys and\n"
  12.            "C:\\Autoexec.bat, and then display them\n"
  13.            "both on the screen together.  This example\n"
  14.            "is like BootEd2 but this uses spawn().",
  15.            "BootEd2 - Description");
  16.  
  17. // start up two versions of notepad with the two files we care about
  18. Config = spawn(P_NOWAIT,"NotePad.exe"," c:\\Config.sys");
  19. AutoExec = spawn(P_NOWAIT,"NotePad.exe","c:\\AutoExec.bat");
  20.  
  21. // position these two windows to fill the top-half and the bottom-half of
  22. // the screen
  23. ScreenWidth = GetSystemMetrics(SM_CXSCREEN);
  24. ScreenHeight = GetSystemMetrics(SM_CYSCREEN);
  25.  
  26. MoveWindow(Config,0,0,ScreenWidth,ScreenHeight/2,True);
  27. MoveWindow(AutoExec,0,ScreenHeight/2,ScreenWidth,ScreenHeight/2,True);
  28.  
  29.